import requests
# 使用get方式发送请求
# 在地址栏拼接参数 www.xxx.com/?key1=value1&key2=value2
# {key1:value1}
#Requests除了这种方式，还有可以使用params传参
# requests=requests.get("https://www.baidu.com/s?wd=python")
#data={'wd':"java"}
#response=requests.get("https://www.baidu.com/s?wd=python")
#print(response.url)
#print(response.text)



#
headers={
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
}
req=requests.get("https://www.baidu.com/",headers=headers)
print(req.content.decode("utf-8"))